<%--
The Community Project
Copyright Team1 Productions

Joshua Amick
Stephen Cunningham
Thema Davis
Tomika Dawson
Lucie DeCristifaro

This JSP is an implementation of the user interface for the Community Project.  Several
tag libraries and custom libraries are used.

All Rights reserved.
--%>

<%@ page %>
<%@ page contentType="text/html"%>
<%@ page pageEncoding="UTF-8"%>

<%-- jstl taglibs --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%-- struts taglibs --%>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<%-- custom taglib by Josh --%>
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags/custom" %>

<c:set var="basePath">
	${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}
</c:set>
<c:set var="servletPath">
	${pageContext.request.servletPath}
</c:set>

<base href="${basePath}/" />

<%-- page content --%>
<custom:frame>
		<div id="styleTitle">
			Profile
		</div></br>
	<page:title title="Edit My Profile"/>
	<html:form action="/Forward.do?loc=changePassword" method="post">
		Username: ${AUTH_USER.username} </br>
		<%--Password: ******** </br>--%>
		<html:submit value="&nbsp;Change Password&nbsp;"/>
	</html:form>
		<div id="styleErrors">
			<c:if test="${not empty ERRORS}">
				${ERRORS}
			</c:if>
		</div>
		<div id="styleInfo">	
			<c:if test="${not empty INFO}">
				${INFO}
			</c:if>
		</div>
		
	<c:set var="USER" value="${AUTH_USER_PROFILE_FORM}"/>
		<c:if test="${empty USER}">
       		<c:set var="USER" value="${AUTH_USER.profile}"/>
	</c:if>
		
	<html:form action="/SaveProfile" method="post">
			Personal Information</br>
			<!--First Name&nbsp;-->
			<custom:text label="First Name" labelStyle="rightLabel" property="firstName" initial="${USER.firstName}"/>
			<custom:text label="Last Name" labelStyle="rightLabel" property="lastName" initial="${USER.lastName}"/>
			<custom:text label="Address" labelStyle="rightLabel" property="address1" initial="${USER.address1}"/>
			<custom:text label="Address 2" labelStyle="rightLabel" property="address2" initial="${USER.address2}"/>
			<custom:text label="City" labelStyle="rightLabel" property="city" initial="${USER.city}"/>
			
			<!--State&nbsp;-->
			<label class="rightLabel" for="stateSelect">State</label>
			<html:select styleId="stateSelect" property="state" value="${USER.state}">
                <html:option value="State"/>
                <html:option value="Alabama"/>
                <html:option value="Alaska"/>
                <html:option value="Arizona"/>
                <html:option value="Arkansas"/>
                <html:option value="California"/>
                <html:option value="Colorado"/>
                <html:option value="Connecticut"/>
                <html:option value="Delaware"/>
                <html:option value="Florida"/>
                <html:option value="Georgia"/>
               
                <html:option value="Hawaii"/>
                <html:option value="Idaho"/>
                <html:option value="Illinois"/>
                <html:option value="Indiana"/>
                <html:option value="Iowa"/>
                <html:option value="Kansas"/>
                <html:option value="Kentucky"/>
                <html:option value="Louisiana"/>
                <html:option value="Maine"/>
                <html:option value="Maryland"/>
               
                <html:option value="Massachusetts"/>
                <html:option value="Michigan"/>
                <html:option value="Minnesota"/>
                <html:option value="Mississippi"/>
                <html:option value="Missouri"/>
                <html:option value="Montana"/>
                <html:option value="Nebraska"/>
                <html:option value="Nevada"/>
                <html:option value="New Hampshire"/>
                <html:option value="New Jersey"/>               
               
                <html:option value="New Mexico"/>
                <html:option value="New York"/>
                <html:option value="North Carolina"/>
                <html:option value="North Dakota"/>
                <html:option value="Ohio"/>
                <html:option value="Oklahoma"/>
                <html:option value="Oregon"/>
                <html:option value="Pennsylvania"/>
                <html:option value="Rhode Island"/>
                <html:option value="South Carolina"/>               
               
                <html:option value="South Dakota"/>
                <html:option value="Tennessee"/>
                <html:option value="Texas"/>
                <html:option value="Utah"/>
                <html:option value="Vermont"/>
                <html:option value="Virginia"/>
                <html:option value="Washington"/>
                <html:option value="West Virginia"/>
                <html:option value="Winsconsin"/>
                <html:option value="Wyoming"/>               
            </html:select></br>
						
			5-digit Zipcode&nbsp;<html:text property="zip" size="5" maxlength="5" value="${USER.zip}"/></br>		
			Sec'd. Email&nbsp;<html:text property="secondaryEmail" value="${USER.secondaryEmail}"/></br>
			Phone&nbsp;<html:text property="phone" value="${USER.phone}"/></br>
	    
	    	</br>
			Professional Information</br>
			Education&nbsp;</br>
			<html:textarea property="education" rows="3" cols="28" value="${USER.education}"/></br>
			<c:set var="majorValue">
				${USER.major}
			</c:set>
			<c:if test="${empty majorValue}">
				<c:set var="majorValue">
					Major
				</c:set>
			</c:if>
			Major&nbsp;
			<html:select property="major" value="${majorValue}">
		        <html:option value="Major"/>
		        <html:option value="Computer Science"/>
		        <html:option value="Computer Engineering"/>
		        <html:option value="Computer Information Systems"/>
		        <html:option value="Other"/>
            </html:select></br>
			Graduation Date&nbsp;			
			<html:select property="gradYear" value="${AUTH_USER_PROFILE_FORM.gradYear}">
                <html:option value="Year"/>
                <html:option value="2003"/>
                <html:option value="2004"/>
                <html:option value="2005"/>
                <html:option value="2006"/>
                <html:option value="2007"/>
                <html:option value="2008"/>
                <html:option value="2009"/>
                <html:option value="2010"/>
                <html:option value="2011"/>
                <html:option value="2012"/>
                <html:option value="2013"/>
                <html:option value="2014"/>
            </html:select>
			<html:select property="gradMonth" value="${AUTH_USER_PROFILE_FORM.gradMonth}">
                <html:option value="Month"/>
                <html:option value="01"/>
                <html:option value="02"/>
                <html:option value="03"/>
                <html:option value="04"/>
                <html:option value="05"/>
                <html:option value="06"/>
                <html:option value="07"/>
                <html:option value="08"/>
                <html:option value="09"/>
                <html:option value="10"/>
                <html:option value="11"/>
                <html:option value="12"/>
            </html:select>
			<html:select property="gradDay" value="${AUTH_USER_PROFILE_FORM.gradDay}">
                <html:option value="Day"/>
                <html:option value="01"/>
                <html:option value="02"/>
                <html:option value="03"/>
                <html:option value="04"/>
                <html:option value="05"/>
                <html:option value="06"/>
                <html:option value="07"/>
                <html:option value="08"/>
                <html:option value="09"/>
                <html:option value="10"/>
                <html:option value="11"/>
                <html:option value="12"/>
                <html:option value="13"/>
                <html:option value="14"/>
                <html:option value="15"/>
                <html:option value="16"/>
                <html:option value="17"/>
                <html:option value="18"/>
                <html:option value="19"/>
                <html:option value="20"/>
                <html:option value="21"/>
                <html:option value="22"/>
                <html:option value="23"/>
                <html:option value="24"/>
                <html:option value="25"/>
                <html:option value="26"/>
                <html:option value="27"/>
                <html:option value="28"/>
                <html:option value="29"/>
                <html:option value="30"/>
                <html:option value="31"/>
            </html:select></br>
			Employer&nbsp;<html:text property="employer" value="${USER.employer}"/></br>
			Employment Start Date&nbsp;						
			<html:select property="empStartYear" value="${AUTH_USER_PROFILE_FORM.empStartYear}">
                <html:option value="Year"/>
                <html:option value="2003"/>
                <html:option value="2004"/>
                <html:option value="2005"/>
                <html:option value="2006"/>
                <html:option value="2007"/>
                <html:option value="2008"/>
                <html:option value="2009"/>
                <html:option value="2010"/>
                <html:option value="2011"/>
                <html:option value="2012"/>
                <html:option value="2013"/>
                <html:option value="2014"/>
            </html:select>
			<html:select property="empStartMonth" value="${AUTH_USER_PROFILE_FORM.empStartMonth}">
                <html:option value="Month"/>
                <html:option value="01"/>
                <html:option value="02"/>
                <html:option value="03"/>
                <html:option value="04"/>
                <html:option value="05"/>
                <html:option value="06"/>
                <html:option value="07"/>
                <html:option value="08"/>
                <html:option value="09"/>
                <html:option value="10"/>
                <html:option value="11"/>
                <html:option value="12"/>
            </html:select>
			<html:select property="empStartDay" value="${AUTH_USER_PROFILE_FORM.empStartDay}">
                <html:option value="Day"/>
                <html:option value="01"/>
                <html:option value="02"/>
                <html:option value="03"/>
                <html:option value="04"/>
                <html:option value="05"/>
                <html:option value="06"/>
                <html:option value="07"/>
                <html:option value="08"/>
                <html:option value="09"/>
                <html:option value="10"/>
                <html:option value="11"/>
                <html:option value="12"/>
                <html:option value="13"/>
                <html:option value="14"/>
                <html:option value="15"/>
                <html:option value="16"/>
                <html:option value="17"/>
                <html:option value="18"/>
                <html:option value="19"/>
                <html:option value="20"/>
                <html:option value="21"/>
                <html:option value="22"/>
                <html:option value="23"/>
                <html:option value="24"/>
                <html:option value="25"/>
                <html:option value="26"/>
                <html:option value="27"/>
                <html:option value="28"/>
                <html:option value="29"/>
                <html:option value="30"/>
                <html:option value="31"/>
            </html:select></br></br>
			Position&nbsp;<html:text property="positionDescription" value="${USER.positionDescription}"/></br>
			Professional Organizations: (LIST)</br><html:textarea property="professionalOrganizations" rows="3" cols="28" value="${USER.professionalOrganizations}"/></br>
			Student Organizations: (LIST)</br><html:textarea property="studentOrganizations" rows="3" cols="28" value="${USER.studentOrganizations}"/></br>
			
			 </br>  
			 <%-- 
			Options</br>
			Make my profile publicly viewable&nbsp;</br>
			&nbsp;&nbsp;<html:radio property="publicViewable" value="true"/> Yes&nbsp;&nbsp;
			<html:radio property="publicViewable" value="false"/> No</br>            
			Subscribe to auto emails and newsletters&nbsp;</br>
			&nbsp;&nbsp;<html:radio property="subscribedToEmails"  value="true"/> Yes&nbsp;&nbsp;     
			<html:radio property="subscribedToEmails"  value="false"/> No</br>     
			Grant or take away this user's admin rights&nbsp;</br>
			&nbsp;&nbsp;<html:radio property="isAdminUser"  value="true"/> Yes&nbsp;&nbsp;
			<html:radio property="isAdminUser"  value="false"/> No</br>
		    </br>--%>
		    
		    <%--
		    Options checked in action
			<html:checkbox property="publicViewable"/> Make my profile publicly viewable&nbsp;</br>                 
			<html:checkbox property="subscribedToEmails"/> Subscribe to auto emails and newsletters&nbsp;</br>                
			<html:checkbox property="isAdminUser"/> Grant or take away this user's admin rights&nbsp;</br>     
		    </br>  
		    --%> 		
			
			<c:choose>
				<c:when test="${AUTH_USER_PROFILE_FORM.publicViewable=='true'}">
					<input type=checkbox name="publicViewable" value="true"  checked="yes"/>
				</c:when>
				<c:otherwise>
					<input type=checkbox name="publicViewable" value="true"/>
				</c:otherwise>
			</c:choose>		
			Make my profile publicly viewable&nbsp;</br> 
			
			<c:choose>
				<c:when test="${AUTH_USER_PROFILE_FORM.subscribedToEmails=='true'}">
					<input type=checkbox name="subscribedToEmails" value="true"  checked="yes"/>
				</c:when>
				<c:otherwise>
					<input type=checkbox name="subscribedToEmails" value="true"/>
				</c:otherwise>
			</c:choose>
			Subscribe to auto emails and newsletters&nbsp;</br>	
		    
		    <html:submit value="&nbsp;Submit&nbsp;"/>
	</html:form>
</custom:frame>